<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <h2>{{message}}</h2>

    <my-cpn></my-cpn>
</div>

<template id="cpn">
    <div>
        <h2>{{title}}</h2>
        <p>实际开发</p>
    </div>
</template>

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>

    Vue.component('MyCpn', {
        data() {
          return {
              title: '组件中的数据'
          }
        },
        template: '#cpn'
    })
    const app = new Vue({
        el: '#app',
        data: {
            message: 'simplelu'
        }
    })
</script>
</body>
</html>